home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / man / compile.hlp < prev    next >
Text File  |  1997-04-13  |  3KB  |  85 lines

  1. compile [-c_code] [options] <Root-Class> [<Root-Procedure>]
  2.  
  3. Command `compile' is the SmallEiffel compiler.
  4. Source code is Eiffel and target Code is ANSI C code.
  5.  
  6. Execution of command `compile' has two major steps.
  7.  
  8. First Step : command `compile_to_c' is called to produce various
  9. ----------   C files (*.h and *.c). A script file is also produced
  10.              by command `compile_to_c'. The name of the script file
  11.              is also printed by command `compile_to_c' (*.make on
  12.              Unix or *.BAT on DOS for example). 
  13. Second Step : C compiling, and C linking of C files using the 
  14. -----------  script produced at first step.
  15.  
  16. Thus, command `compile' is a simple driver to call separately
  17. command `compile_to_c' and the to call the C compiler.
  18.  
  19. As command `compile_to_c', command `compile' must have at least 
  20. one argument to indicate the starting execution point of the system.
  21. Thus, execution will start in <Root-Procedure> of <Root-Class>.
  22. The default <Root-Procedure> is `make'.
  23.  
  24. -c_code : All options of command `compile_to_c' can be used with
  25.    command `compile' (they are simply passed to command 
  26.    `compile_to_c'). Option -c_code is the only one not to be passed
  27.    to command `compile_to_c'.
  28.    The option -c_code must be used if you want to save the produced
  29.    C code (as well as object files). Saving C code is useful for
  30.    application delivery. 
  31.    Saving C code also turns on the incremental C compilation mode.
  32.    Each old C file is saved as well as the corresponding object file.
  33.    Only modified C files are recompiled. When a C file is not modified,
  34.    the corresponding old object file is used. Be careful with 
  35.    additional C options because they are not take in account when 
  36.    using -c_code option (see example 3 below to work around).
  37.   
  38. - Example 1 - 
  39.    When SmallEiffel is correctly installed, you can simply type 
  40.    the following command to test the hello world program :
  41.  
  42.       compile hello_world
  43.  
  44.    The compiler should tell you what's wrong or should compile
  45.    Eiffel source files telling you the full path used to load
  46.    the Eiffel source code.
  47.    Under UNIX, the executable file is named "a.out" by default.
  48.  
  49. - Example 2 - 
  50.    Type following command to finalize the hello_world simple 
  51.    program :
  52.  
  53.       compile -boost -no_split -O3 hello_world
  54.  
  55.    Note that option -O3 is passed to the C compiler (see manual
  56.    of gcc). Options -boost and -no_split are passed to command
  57.    `compile_to_c' (see compile_to_c.hlp). This is usually the
  58.    best way to finalize.
  59.   
  60.    Only one C file is produce (option -no_split)
  61.  
  62. - Example 3 - 
  63.    To compile a big project (class PROJECT) with C code saving 
  64.    and require assertions checked :
  65.  
  66.       compile -c_code -require_check project
  67.  
  68.    The very first time, all C files are produced and compiled. 
  69.    Then, if you type the same command after some changes in the 
  70.    Eiffel source files, all C files are also produced from scratch.
  71.    If you are lucky (if there are only minor changes in produced
  72.    C files), only modified C files are passed to the C compiler
  73.    (object files have been saved). 
  74.    Keep in mind that C compiler options are not taken in account.
  75.    Thus if you now want to do :
  76.  
  77.       compile -c_code -require_check project   -O3
  78.  
  79.    You must use the clean command before :
  80.  
  81.       clean project
  82.  
  83.    All C files will be then recompiled using the new C option -O3.
  84.    You are thus sure that the new C options are taken in account.
  85.